{
  "properties" : { },
  "id" : "copy1730792167807d92012",
  "script" : null,
  "groupId" : "c0cf605f74e34bc6953194a869f4a6cd",
  "name" : "FX_TOPN统计国家站实时数据",
  "createTime" : 1732780546966,
  "updateTime" : 1730881397484,
  "lock" : null,
  "createBy" : "admin",
  "updateBy" : "admin",
  "path" : "/regiontopn",
  "method" : "GET",
  "parameters" : [ {
    "name" : "regioncode",
    "value" : "220099",
    "description" : "行政区划编码查询 不填查全部",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "time",
    "value" : "",
    "description" : "数据可以按找小时获取  yyyy-MM-ddTHH:00:00",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "page",
    "value" : null,
    "description" : "页号",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : "1",
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "size",
    "value" : null,
    "description" : "每页大小",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : "10",
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "strorder",
    "value" : "order by prec desc",
    "description" : "order by",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 0,\n    \"message\": \"success\",\n    \"data\": {\n        \"total\": 2,\n        \"list\": [\n            {\n                \"stationKey\": \"54285\",\n                \"lat\": 42.4044,\n                \"lon\": 128.1247,\n                \"high\": 731.7,\n                \"city\": \"延边朝鲜族自治州\",\n                \"stationName\": \"二道\",\n                \"cnty\": \"安图县\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 936.6,\n                \"pres_sea\": 1022.4,\n                \"temp\": 9,\n                \"temp_max\": 9,\n                \"temp_min\": 7.5,\n                \"humi\": 82,\n                \"humi_min\": 82,\n                \"prec\": 0,\n                \"win_10_dir\": 339,\n                \"win_10_vel\": 2.2,\n                \"win_inst_dir\": 334,\n                \"win_inst_vel\": 3.8,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"222426\",\n                \"norainday\": 21,\n                \"wep_value\": null\n            },\n            {\n                \"stationKey\": \"54287\",\n                \"lat\": 42.0283,\n                \"lon\": 128.0678,\n                \"high\": 2620,\n                \"city\": \"延边朝鲜族自治州\",\n                \"stationName\": \"天池\",\n                \"cnty\": \"安图县\",\n                \"timeBase\": \"2024-10-22T09:00:00\",\n                \"pres\": 742.5,\n                \"pres_sea\": 1022.6,\n                \"temp\": 1.7,\n                \"temp_max\": 2.3,\n                \"temp_min\": 1.2,\n                \"humi\": 26,\n                \"humi_min\": 26,\n                \"prec\": 0,\n                \"win_10_dir\": 81,\n                \"win_10_vel\": 3.4,\n                \"win_inst_dir\": 77,\n                \"win_inst_vel\": 6.9,\n                \"snow\": 999999,\n                \"WEP_Now\": 0,\n                \"code\": \"222426\",\n                \"norainday\": 1,\n                \"wep_value\": null\n            }\n        ]\n    },\n    \"timestamp\": 1730881388360,\n    \"executeTime\": 110\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "1",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "success",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "Hello magic-api",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "timestamp",
      "value" : "1723701688631",
      "description" : "",
      "required" : false,
      "dataType" : "Long",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "executeTime",
      "value" : "174",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
/**
 *   按照机构号码查询、
 *  @param   regioncode  行政区划编码查询不填查全部
 *  @param   time        时间格式数据可以按找小时获取  yyyy-MM-ddTHH:00:00   不传查最新 传查指定时间  必须传入整点数据
 *  @param   page   默认 1
 *  @param   size   默认 20
 *  @param   ord    
 */
var sql = """
  
   
    select t1.*,w.wep_value from stationdata_region t1  
    join( select stationKey ,max(timeBase) as latest_timestamp 
    from stationdata_region
    where 1 = 1 
    
    <if test="time != null and time != ''\" > and DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s') = timeBase </if>
    group by stationKey
    )  t2 on t1.stationKey = t2.stationKey and t1.timeBase = t2.latest_timestamp 
    left  join wep_dic w on w.wep_key =  t1.WEP_Now
    join region_info b  on b.stationkey = t1.stationkey and 1= 1
    <if test="regioncode != null and regioncode != ''" > and orgid LIKE CONCAT(#{regioncode},'%') </if>
      <if test="strorder != null and strorder != ''" >
          ${strorder} 
      </if>
    
    


"""
return db.page(sql);